# 订单数据结构

# order_type:
#   - market_order: 市价订单
#   - limit_order: 限价订单

# direction:
#   - BUY / SELL


class Order:
    strategy_name = ''
    strategy_order_id = ''
    system_order_id = ''
    order_type = 'market_order'
    inst_id = ''
    direction = ''
    price = 0.0
    volume = 0
    information = ''

    def __init__(self, strategy_name='', strategy_order_id='',
                 order_type='market_order', inst_id='', direction='',
                 price=0.0, volume=0, information=''):
        self.strategy_name = strategy_name
        self.strategy_order_id = strategy_order_id
        self.order_type = order_type
        self.inst_id = inst_id
        self.direction = direction
        self.price = price
        self.volume = volume
        self.information = information

    def __str__(self):
        return '<Order: {}, {}, {}, {}, {}, {}, {}, {}>'.\
            format(self.strategy_name, self.strategy_order_id,
                   self.order_type, self.inst_id, self.direction, self.price,
                   self.volume, self.information)

